/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.trader.utils;

import ca.trader.logger.TraderLogger;
import java.util.TreeSet;

/**
 * A TreeSet with all the TreeSet functionality, with the addition of the ability to find an identical item 
 * @author Ahsan
 */
public class TraderTreeSet<T> extends TreeSet<T>
{

	 /**
	  * Give an object, finds the identical item to that.
	  * The equality of the items is checked by the equals method
	  * @param objectToFind
	  * @return 
	  */
	 public T findIdenticalItem(T objectToFind)
	 {
		  for (T obj : this)
		  {
			   if (obj.equals(objectToFind))
			   {
				    
				    return obj;
			   }
		  }

		  return null;
	 }
}
